/**
 * createTime: 2018/4/17 13:39
 * author: zhibin.zhao
 * description:
 */
const Koa = require('koa');
const app = new Koa();
const Router = require('koa-router');
const router = new Router();

router
    .get('/', (ctx, next)=>{
        ctx.body = 'Hello World!'
    })
    .get('/todo', (ctx, next)=>{
        ctx.body = "Todo page";
    });

app
    .use(router.routes())
    .use(router.allowedMethods());

app.listen(3000, ()=>{
    console.log('starting at port 3000');
});